package com.weiyun.controller;

import com.weiyun.pojo.User;
import com.weiyun.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/***
 *   @Author:weiyun
 *
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;
    @RequestMapping("/selectAllUser")
    public Map<String, Object> selectAllUser() {
        List<User> users = userService.selectAll();
        HashMap<String, Object> resultMap = new HashMap<>();
        resultMap.put("code", 200);
        resultMap.put("users", users);
        return resultMap;
    }
}
